package cn.z2huo.demo.log.aop.web.aspect;

import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.Signature;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Pointcut;
import org.aspectj.lang.reflect.MethodSignature;
import org.springframework.core.annotation.Order;

/**
 * <p>
 *
 * @author z2huo
 */
@Slf4j
//@Aspect
//@Component
@Order(1)
public class OperateLogServiceAspect {

    @Pointcut("execution(* cn.z2huo.demo.log.aop.web.service.impl.OperateLogServiceImpl.insertLog(..))")
    public void insertPoint(){
    }

    @Around(value = "insertPoint()")
    public Object around(ProceedingJoinPoint point) throws Throwable {

        log.info("insert Operate Log aspect");

        Signature signature = point.getSignature();
        String name = signature.getName();

        MethodSignature signature2 = (MethodSignature) point.getSignature();
        String[] parameterNames = signature2.getParameterNames();

        return point.proceed();
    }

}
